
enum SIZE {
    //% block="29*29"
    1,
    //% block="58*58"
    2
}

enum LINE {
    //% block="1"
    1,
    //% block="2"
    2,
    //% block="3"
    3,
    //% block="4"
    4
}

enum BTN {
    //% block="A"
    A,
    //% block="B"
    B,
    //% block="A+B"
    AB
}


//% color="#AA278D" iconWidth=35 iconHeight=35
namespace bmp180 {
    
  
    //% block="BMP180初始化" blockType="command"
    export function inital(parameter: any, block: any) {
        //let width = parameter.WIDTH.code
        
        Generator.addInclude('bmp180', '#include <SFE_BMP180.h>');
        Generator.addInclude('wire', '#include <Wire.h>');
        Generator.addObject(`bmp180`, `SFE_BMP180`, `mybmp180;`);  
        Generator.addSetup(`mybmp180.begin`, `mybmp180.begin();`);
      
    }

 
    //% block="读取温度值（°C） " blockType="reporter"
    export function getTemperature(parameter: any, block: any) {
       
       
         Generator.addCode(`mybmp180.showTemperature()`);
        
    }

     //% block="读取气压值（mbar）" blockType="reporter"
     export function getPressure(parameter: any, block: any) {
        
        Generator.addCode(`mybmp180.showPressure()`);
     
   }

    
    function replace(str :string) {
        return str.replace("+", "");
    }
    
}
